package com.wlyy.his.controller.user.pc;

import com.wlyy.his.common.api.CommonResult;
import com.wlyy.his.infrastructure.common.RequestUserInfo;
import com.wlyy.his.bean.user.pc.vo.AccountInfoVo;
import com.wlyy.his.service.ums.IAccountInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 个人档案
 *
 * @Author zhouyanhui
 * @Date 2021-09-01 15:27
 **/

@RestController
@RequestMapping("/account")
public class AccountInfoController {

    @Resource
    private IAccountInfoService accountInfoService;
    @Resource
    private RequestUserInfo requestUserInfo;

    @GetMapping("/info")
    public CommonResult getAccountInfo(){
        AccountInfoVo accountInfoVo = accountInfoService.getAccountInfo(requestUserInfo.getAccountId());
        if (null!=accountInfoVo){
            return CommonResult.success(accountInfoVo);
        }else{
            return CommonResult.failed();
        }
    }

}
